package com.lft.com.oilgas.mapper;

import com.lft.com.oilgas.entity.Driver;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tyqw
 * @since 2024-09-10
 */
public interface DriverMapper extends BaseMapper<Driver> {
    @Select("SELECT " +
            " driverlicense.front AS driver_front, " +
            " drivinglicense.front AS driving_front, " +
            " driver.*," +
            " id_card.* " +
            "FROM driver " +
            "INNER JOIN driverlicense " +
            "ON driver.driver_license = driverlicense.id " +
            "INNER JOIN drivinglicense " +
            "ON driver.driving_license = drivinglicense.id " +
            "INNER JOIN id_card " +
            "ON  driver.card_id = id_card.id")
    List<Map> selectDriver();
}
